import React from "react"

export default class Base05 extends React.Component {

    constructor() {
        super();
        this.Div1 = React.createRef();
        this.Div2 = React.createRef();

    }

    componentDidMount() {
        this.Div1.current.style.color = "red";
        this.Div2.current.style.color = "blue";
    }

    render() {
        return (
            <div>
                <p> Refs和DOM</p>

                <div ref={this.Div1}>
                    {789} Div1
                </div>
                <br />
                <div ref={this.Div2}>
                    Div2
                </div>
            </div>
        )
    }
}